Skip to content

Document directory path markers in the FAQ - #168

Open
tongwentao wants to merge 1 commit into
cpburnz:masterfrom
tongwentao:docs/directory-path-matching
Open

tongwentao wants to merge 1 commit into
cpburnz:masterfrom
tongwentao:docs/directory-path-matching

Conversation

@tongwentao

Copy link
Copy Markdown

Add a FAQ explaining why a directory-only gitignore pattern matches build/ but not the bare path build when using match_file() or match_files().

The distinction discussed in #89 is easy to miss: these methods match supplied paths without checking the filesystem, and pathlib.Path does not preserve a trailing slash. Include executable examples and point readers to the entry-based methods, which supply directory markers automatically. Matching behavior is unchanged.

Validation on Linux, Python 3.13.5:

  • All five statements in the new FAQ passed with doctest.
  • The project's python -m unittest discover -t . -s tests/ command completed successfully. Optional RE2/Hyperscan cases were skipped because those extras are not installed.
  • The configured strict Sphinx command (sphinx-build -aWEnqb html) passed; checked the rendered FAQ and navigation.
  • git diff --check passed.

Related to #89; this documents the existing behavior rather than changing or closing that issue. Prepared and validated with Codex assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant